import Vue from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'
Vue.config.productionTip = false

const bus=new Vue();
Vue.prototype.$bus=bus;   //this.$bus 挂载到原型链    事件中央总线

// 全局的项目入口   
console.log('main -  vue 主入口文件 ')

import "@/assets/styles/index.scss"

//淘宝适配
import 'lib-flexible'

//vant 组件
import Vant from 'vant'
Vue.use(Vant)
import 'vant/lib/index.css'

//按需加载
// import '@/utils/vant'
// import "@/utils/golbal"

//全局注册组件
import '@/components'

import {axios,baseURL} from "@/api/http"
Vue.prototype.$axios=axios;
Vue.prototype.$host=baseURL;

//api 封装的全局调用
import {ajax} from "@/api/index"
Vue.prototype.$ajax=ajax;

//全局可使用  vant 图片懒加载
import {Lazyload } from "vant";
Vue.use(Lazyload,{
  lazyComponent: true,
  loading: require('@/assets/images/fengmian.jpg'),
  error:require('@/assets/images/fengmian.jpg'),
})




new Vue({
  router,   // this.$router 
  store,     
  render: h => h(App)    // 渲染根组件  
}).$mount('#app')